home *** CD-ROM | disk | FTP | other *** search
- unit Rtti3u;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, Grids, DBGrids, DB, DBTables, Menus;
-
- type
- TForm1 = class(TForm)
- MainMenu1: TMainMenu;
- N1: TMenuItem;
- N2: TMenuItem;
- N3: TMenuItem;
- N4: TMenuItem;
- DataSource1: TDataSource;
- Table1: TTable;
- DBGrid1: TDBGrid;
- procedure TableMenuClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.TableMenuClick(Sender: TObject);
- begin
- if Sender is TMenuItem then
- { Ensure menu item is last so the Tag references go to it, not the table }
- with Screen, Table1, TMenuItem(Sender) do
- begin
- Cursor := crHourGlass;
- try
- DisableControls;
- Close;
- case Tag of
- 1: TableName := 'CUSTOMER';
- 2: TableName := 'ORDERS';
- 3: TableName := 'ITEMS';
- end;
- if TableName <> '' then
- Open;
- EnableControls;
- finally
- Cursor := crDefault;
- end;
- end;
- end;
-
- end.
-